<div class="yiiForm">

<?php 
if(Yii::app()->user->hasFlash('model')) {
	Yii::app()->user->flash('model', array('<div class="confirmation">', '</div>'));
	return;
}


$JFV=Yii::app()->jformvalidate;

$JFV->setOptions(array(
		'errorElement'=> 'div',
		'errorClass' => 'invalid',
        ));



echo $JFV->form();

?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo Html::errorSummary($model); ?>

	<div class="row">
		<?php echo Html::activeLabel($model,'title'); ?>
		<?php echo $JFV->activeTextField($model,'title',array('size'=>60,'maxlength'=>200)); ?>
		
	</div>

	<div class="row">
		<?php echo Html::activeLabel($model,'author'); ?>
		<?php echo $JFV->activeTextField($model,'author'); ?>
		
	</div>

	<div class="row">
		<?php echo Html::activeLabel($model,'language'); ?>
		<?php echo $JFV->activeTextField($model,'language',array('size'=>3,'maxlength'=>3)); ?>
		
	</div>

	<div class="row">
		<?php echo Html::activeLabel($model,'description'); ?>
		<?php echo $JFV->activeTextField($model,'description',array('size'=>60,'maxlength'=>250)); ?>
		
	</div>

	<div class="row">
		<?php echo Html::activeLabel($model,'content'); ?>
		<?php echo $JFV->activeTextField($model,'content',array('rows'=>6, 'cols'=>50)); ?>
		
	</div>

	<div class="row">
		<?php echo Html::activeLabel($model,'tags'); ?>
		<?php echo $JFV->activeTextField($model,'tags',array('rows'=>6, 'cols'=>50)); ?>
		
	</div>

	<div class="row">
		<?php echo Html::activeLabel($model,'image'); ?>
		<?php echo $JFV->activeTextField($model,'image',array('size'=>60,'maxlength'=>100)); ?>
		
	</div>

	<div class="row">
		<?php echo Html::activeLabel($model,'created'); ?>
		<?php echo $JFV->activeTextField($model,'created'); ?>
		
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array('class'=>'submit')); ?>
	</div>


<?php echo $JFV->endForm(); ?>

</div><!-- form -->
<script type="text/javascript">
$("form").bind("submit", function() { ;return false; });

$.ajaxSetup({
'beforeSend': function(xhr) {xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")},
});

$('.submit').bind('click', function () {
  jQuery.ajax({
'type':'POST',
'dataType' : 'html',
'url': jQuery(this).parents("form").attr("action"),
'cache':false,
'data':jQuery(this).parents("form").serialize(),
'success':function(html){
jQuery("#content").html(html)}
});
  return false;
});

</script>



